package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysExchangeMapper;
import com.ruoyi.project.system.domain.SysExchange;
import com.ruoyi.project.system.service.ISysExchangeService;

/**
 * 兑换码记录Service业务层处理
 *
 * @author theme
 * @date 2021-08-06
 */
@Service
public class SysExchangeServiceImpl implements ISysExchangeService
{
    @Autowired
    private SysExchangeMapper sysExchangeMapper;

    /**
     * 查询兑换码记录
     *
     * @param exchangeId 兑换码记录ID
     * @return 兑换码记录
     */
    @Override
    public SysExchange selectSysExchangeById(Long exchangeId)
    {
        return sysExchangeMapper.selectSysExchangeById(exchangeId);
    }

    /**
     * 查询兑换码记录列表
     *
     * @param sysExchange 兑换码记录
     * @return 兑换码记录
     */
    @Override
    public List<SysExchange> selectSysExchangeList(SysExchange sysExchange)
    {
        return sysExchangeMapper.selectSysExchangeList(sysExchange);
    }

    /**
     * 新增兑换码记录
     *
     * @param sysExchange 兑换码记录
     * @return 结果
     */
    @Override
    public int insertSysExchange(SysExchange sysExchange)
    {
        sysExchange.setCreateTime(DateUtils.getNowDate());
        return sysExchangeMapper.insertSysExchange(sysExchange);
    }

    @Override
    public int insertBatchSysExchange(List<SysExchange> list) {
        return sysExchangeMapper.insertBatchSysExchange(list);
    }

    /**
     * 修改兑换码记录
     *
     * @param sysExchange 兑换码记录
     * @return 结果
     */
    @Override
    public int updateSysExchange(SysExchange sysExchange)
    {
        sysExchange.setUpdateTime(DateUtils.getNowDate());
        return sysExchangeMapper.updateSysExchange(sysExchange);
    }

    /**
     * 批量删除兑换码记录
     *
     * @param exchangeIds 需要删除的兑换码记录ID
     * @return 结果
     */
    @Override
    public int deleteSysExchangeByIds(Long[] exchangeIds)
    {
        return sysExchangeMapper.deleteSysExchangeByIds(exchangeIds);
    }

    /**
     * 删除兑换码记录信息
     *
     * @param exchangeId 兑换码记录ID
     * @return 结果
     */
    @Override
    public int deleteSysExchangeById(Long exchangeId)
    {
        return sysExchangeMapper.deleteSysExchangeById(exchangeId);
    }
}
